package hom.homwork.java;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Scanner;

public class Home1Test {
    public static void main(String[] args) {
        Collection<Student>list = new ArrayList<Student>();

        Scanner input = new Scanner(System.in);
        while(true){
            System.out.println("选择（1，录入：0，推出");
            int select = input.nextInt();
            if(select==0){
                break;
            }
            System.out.println("姓名：");
            String name = input.next();
            System.out.println("年纪");
            int age = input.nextInt();
            Student stu = new Student(name,age);
            list.add(stu);
        }
        for (Student stu: list){
            System.out.println(stu);
        }

    }
}

